﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace Labthink.PCSoft.UniversalHost4.Instrument.Converters
{
    public class ReverseConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var bl = value as bool?;
            if (bl == null) return false;
            return !bl.Value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value;
        }
    }
}
